﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Babushka.GameModels.Tiles
{
    abstract class Tile
    {
        public const int TileSize = 32;
        private static List<Tile> _tiles;
        public static void InitTiles()
        {
            _tiles = new List<Tile>();
            AddTile(new UnresponsiveTile(Resources.Graphics.Floor) { TileName = "Some Random Floor Stuff" });
        }

        public static void AddTile(Tile t)
        {
            _tiles.Add(t);
        }

        public static int GetID(Tile t)
        {
            return _tiles.IndexOf(t);
        }

        public static ReadOnlyCollection<Tile> Tiles
        {
            get
            {
                return new ReadOnlyCollection<Tile>(_tiles);
            }
        }

        public abstract Rectangle GetBoundingBox(int x, int y);

        public abstract void DrawTile(int x, int y);

        public virtual string TileName { get; set; }
    }
}